# !/usr/bin/env python
# -*- coding:utf-8 -*-
# @FileName  :ser.py
# @Time      :2022/8/12 10:27
# @Author    :刘明阳

from rest_framework import serializers
from .models import *


class Serstaff(serializers.ModelSerializer):
    depart = serializers.SerializerMethodField()
    def get_depart(self,obj):
        return obj.depart.d_name

    class Meta:
        model = Staff
        fields = '__all__'